﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HFController;
namespace HFWebApp.user
{
    public partial class uc_JobList : BagePages
    {
        public string PageString { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.checkAccountIsLogin();

            if (this.GetQuery("action") != "")
            {
                string id = this.GetQuery("id");
                HFModel.ResultModel result = JobsController.getController().deleteWanted(int.Parse(id));
                Response.Write("<script>alert('" + result.Message + "');location='uc_JobList.aspx'</script>");
                Response.End();
            }

            if (!Page.IsPostBack)
            {
                int PageSize = 10;
                int PageNumber = 1;
                int total = 0;
                if (this.GetQuery("Page") != "")
                {
                    PageNumber = int.Parse(this.GetQuery("Page"));
                }
                hf.Model.User model = this.getLoginAccount();
                string strWhere = "UserID=" + model.ID.ToString();
                Repeater1.DataSource = JobsController.getController().getWantedList(PageSize, PageNumber, "", out total);
                Repeater1.DataBind();
                PageString = LLL.Pager.TrunPageHtmlCode_Web(PageSize, PageNumber, total, "");
            }
        }
    }
}